package cn.wecloud.im.multiplayervideodemo.live

import android.os.Parcelable
import cn.wecloud.im.core.im.messages.MemberDto
import kotlinx.android.parcel.Parcelize

/**
 * 多人视频参数
 */
@Parcelize
data class MultiVideoArgs(
    val conversationId: Long = 0,
    val roomId: String,  //房间id
    val token: String,
    var clientId: String, //发起通话的客户端ID
    val memberDtoList: ArrayList<MemberDto>, //多人rtc成员
) : Parcelable {
    companion object {
        //生成呼叫中的参数
        fun generateCallingArgs(
            conversationId: Long,
            roomId: String,  //房间id
            token: String,
            clientId: String, //发起通话的客户端ID
            members: ArrayList<String>
        ): MultiVideoArgs {
            return MultiVideoArgs(
                conversationId,
                roomId,
                token,
                clientId,
                ArrayList(members.map { MemberDto(it, MemberDto.STATE_CALLING) })
            )
        }
    }
}
